package com.yeming.flink.mudlog.utilclass

import java.lang

import com.yeming.flink.mudlog.LoggingBean
import org.apache.flink.streaming.connectors.kafka.KafkaSerializationSchema
import org.apache.kafka.clients.producer.ProducerRecord

/**
 * Kafka异常数据输出模板类
 */
class ExDataSerializationSchema extends KafkaSerializationSchema[(String,LoggingBean)] {
  override def serialize(element: (String,LoggingBean), timestamp: lang.Long): ProducerRecord[Array[Byte], Array[Byte]] = {
    new ProducerRecord("mudlog_ex_data",
      element._1.getBytes() ,
      element._2.toString.getBytes())
  }
}
